package com.multimedia.scala.euler
/*
The 5-digit number, 16807=7^5, is also a fifth power.
Similarly, the 9-digit number, 134217728=8^9, is a ninth power.

How many n-digit positive integers exist which are also an nth power?
 */
object Asd63 {
  def main(args : Array[String]) : Unit = {
    def countPower(x: BigInt) = {
      def isPowerEqual(y: Int) = x.pow(y).toString.size==y

      (1 to 100).filter(isPowerEqual)
    }
    (1 to 9).map(BigInt(_)).map(x => {x->countPower(x)})
    .foreach(println)
  }
  
}
